<template>
  <el-dialog
    :close-on-click-modal="false"
    :show-close="false"
    :title="isAdd?'新增分类':'修改分类'"
    :visible.sync="isEdit"
  >
    <el-form
      :rules="rules"
      ref="ruleForm"
      :model="form"
      label-width="120px"
      size="small"
      class="form-box"
    >
      <el-form-item label="用户名" prop="advertisersName">
        <el-input type="text" v-model="form.advertisersName" placeholder="请输入供应商名称"></el-input>
      </el-form-item>
      <el-form-item label="密码">
        <el-input type="text" v-model="form.advertisersName" placeholder=""></el-input>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="$emit('closeDialog')" size="small">取消</el-button>
      <el-button @click="submitFormAdd('ruleForm')" type="primary" size="small">确定</el-button>
    </span>
  </el-dialog>
</template>

<script lang="ts">
import { Component, Vue, Prop, Provide } from "vue-property-decorator";
@Component({
  components: {}
})
export default class userEditDialog extends Vue {
  // 属性或参数中使用 ！：表示强制解析（告诉typescript编译器，这里一定有值），常用于vue-decorator中的@Prop
   check:boolean = true//防重复提交
  @Prop(Boolean) isEdit!: boolean;
  @Prop(Boolean) isAdd!: boolean;
  @Prop(Array) projectNames!: [];
  @Provide() dateTime: any = [];
  @Prop(Object) form!: {
    id:number,
    advertisersName: string,
    advertisersKey: string,
    appid:string,
  };
  @Provide() rules: any = {
    advertisersName: [{ required: true, message: "请输入广告商", trigger: "blur" }],
    advertisersKey: [{ required: true, message: "请输入广告商key", trigger: "blur" }],
    appid: [{ required: true, message: "请输入appidkey", trigger: "blur" }],
  };
  // 提交
  submitFormAdd(formName: any) {

  }
   
  created() {
  }
}
</script>

<style lang="scss" scoped>
.form-box {
  .el-input,
  .el-select {
    width: 200px !important;
  }
}
</style>
